home *** CD-ROM | disk | FTP | other *** search
- Path: news.lpr.carel.fi!usenet
- From: Ari Lukumies <aril@cmt.lpr.mail.carel.fi>
- Newsgroups: comp.lang.c
- Subject: Re: Function Offsets
- Date: Tue, 19 Mar 1996 13:12:24 +0200
- Organization: Carelcomp Products
- Message-ID: <314E9698.68E9@cmt.lpr.mail.carel.fi>
- References: <4ih3p4$4gn@cloner4.netcom.com>
- NNTP-Posting-Host: renoir.cclahti.carel.fi
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (WinNT; I)
-
- Matt Kittleson wrote:
- >
- > Is this the best way to get the offset of a function?
- >
- > void main()
- > {
- > void funct1()
- >
- > some code here...blah...blah...blah
- >
- > }
- > [snip]
-
- This merely introduces the existance of function funct1. Actually, it's introduced to
- main() only and that's old programming practice, and so is your format of the main
- function. If you wanted the address of the function, you would want to use something
- like this:
-
- void funct1(void); /* the prototype */
-
- int main(void)
- {
- some code....
-
- void (*func)(void) = funct1; /* a variable to hold the address */
- }
-
- Later,
- AriL
- --
- All my opinions are mine and mine alone.
-